package data.vip;

import java.util.ArrayList;

import data.ListInterIterator;

public class SendRecordfind{
		private ArrayList<SendRecord> list;
		private ArrayList<SendRecord> find=new ArrayList<SendRecord>();
		
		public SendRecordfind (ListInterIterator<SendRecord> list){
			this.list=list.toArray();
		}
		
		public ListInterIterator<SendRecord> find(String key,String message){
			if(key.equals("date")){
			findbydate(message);
			}
			return new ListInterIterator<SendRecord>(find);
		}
		
		private void findbydate(String message){
			for(int i=0;i<list.size();i++){
				if(list.get(i).getDate().equals(message)){
					find.add(list.get(i));
				}
			}
		}

}
